<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {
	
	public function __construct()
	{
		parent::__construct();
		$this->load->model(array('video_model','kategori_model'));    
		$this->load->library(array('template', 'form_validation','session','upload'));    
		$this->load->database();    
		$this->load->helper(array('url','form','string'));
	}
	
	
	public function index()
	{	
		//$this->output->cache(10);
		
		$id_user = $this->session->userdata('id_user');
		$data1 = $this->template->build_template();
		$data['head'] = $this->load->view('/template/head');
		$data['header'] = $this->load->view('/template/header', $data1);
		$data['left'] = $this->load->view('/template/left', $data1);
		$data1['video'] = $this->video_model->get_list_video();
		if($this->session->flashdata('login_sukses')){
			$data1['berhasil'] = '<div class="alert alert-success"><a class="close" data-dismiss="alert">&times</a><h5> <span class="glyphicon glyphicon-thumbs-up "></span> Login berhasil. </h5> </div>';
		} else if ($this->session->flashdata('login_gagal')) {
			$data1['berhasil'] = '<div class="alert alert-danger"><a class="close" data-dismiss="alert">&times</a><h5><span class="glyphicon glyphicon-warning-sign "></span> Maaf akun Anda belum terdaftar atau password salah!</h5></div>';
		} else {
			$data1['berhasil'] = '';
		}
		$data['konten_halaman_utama'] = $this->load->view('/template/konten_halaman_utama', $data1);
		$data['right'] = $this->load->view('/template/right', $data1);
		$data['footer'] = $this->load->view('/template/footer');
		
		$this->load->view('halaman_utama', $data);
	}
	
	
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */